package com.wardrobe.soa.backend.train_manage;

import com.wardrobe.dao.train_manage.TrainManageDao;
import com.wardrobe.domain.common.BackEndFromBean;
import com.wardrobe.domain.train_manage.TrainManageBean;
import com.wardrobe.domain.train_manage.TrainManageShowBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * Created by Administrator on 2018/11/15.
 */
@Service
public class BackTrainManageService {
    @Autowired
    private TrainManageDao trainManageDao;

    public List<TrainManageShowBean> getTrainManage(BackTrainManageBean manageBean){
        return trainManageDao.selectTrainManage(manageBean);
    }

    public TrainManageShowBean getTrainManageById(int id){
        return trainManageDao.selectTrainManageById(id);
    }

    public int addTrainManage(TrainManageBean trainManageBean){
        return trainManageDao.insertTrainManage(trainManageBean);
    }

    public int modifyTrainManage(BackEndFromBean fromBean){
        return trainManageDao.updateTrainMange(fromBean);
    }

    public long countTrainManage(BackTrainManageBean manageBean){
        return trainManageDao.countTrainManage(manageBean);
    }

    public int deleteTrainManage(int id){
        return trainManageDao.deleteTrainManage(id);
    }
}
